package com.yuanrui.wechat.handler;

import lombok.Getter;

@Getter
public enum WechatMsgTypeEnum {
    SUBSCRIBE("event.subscribe", "用户关注事件"),
    TEXT("event.text", "接收用户消息");

    private final String type;
    private final String desc;

    WechatMsgTypeEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static WechatMsgTypeEnum getEnum(String type) {
        for (WechatMsgTypeEnum wechatMsgTypeEnum : WechatMsgTypeEnum.values()) {
            if (wechatMsgTypeEnum.getType().equals(type)) {
                return wechatMsgTypeEnum;
            }
        }
        return null;
    }

}
